//边界布局
package UserInterface;

import java.awt.*;
import javax.swing.*;

public class UserInterface4 {
    public static void main(String[] args) {

        JFrame win = new JFrame("win1");
        win.setSize(300, 200);
        win.setVisible(true);
        win.setTitle("边界布局实例");
        win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        win.setLayout(new BorderLayout());
        win.add("East", new JButton("东"));
        win.add("South", new JButton("南"));
        win.add("West", new JButton("西"));
        win.add("North", new JButton("北"));
        win.add("Center", new JButton("中"));
        win.validate();
    }
}